package d0331;

public class Account {
    private String accoundId;
    private String pwd;
    private double balance;

    public Account() {}

    public Account(String accoundId, String pwd, Double balance) {
        this.accoundId = accoundId;
        this.pwd = pwd;
        this.balance = balance;
    }

    public String getAccoundId() {
        return accoundId;
    }

    public void setAccoundId(String accoundId) {
        this.accoundId = accoundId;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public Double getBalance() {
        return balance;
    }

    public void setBalance(Double balance) {
        this.balance = balance;
    }
    
    @Override
    public String toString() {
        return "Account{" +
                "accoundId='" + accoundId + '\'' +
                ", pwd='" + pwd + '\'' +
                ", balance=" + balance +
                '}';
    }
    public Double save(Double amount) {
        balance = balance + amount;
        return balance;
    }
    public Double pay(Double amount) {
        balance = balance - amount;
        return balance;
    }
}
